/**
 * Created by ZFL on 2018/1/15.
 */
var vm=new Vue({
    el:'#pickUpCode',
    data:{
        expressTime:'',
        storeName:'',
        storeAddress:'',
        takeCode:'',
        logoPath:'',
        storeTel:'',
        remainingTime:0,
        deliveryWay:''
    }
})
function PageInit(){
    if(com_obj.userId>0){
        vm.deliveryWay= $.getPara('deliveryWay')
        getReceiveCode();
    }
}

function getReceiveCode(){
    $.ajaxHandler({
        model:function(){
            var obj={};
            obj.orderSn= $.getPara('orderSn');
            obj.userId=com_obj.userId;
            return obj;
        },
        visibleTime: 0,
        visible:'show',
        approve: true,
        api:"yg_baijiaplatform/order/getReceiveCode",
        success:function(res){
            if(res.code==10000){
                var data=res.data;
                var obj={};
                vm.expressTime=data.expressTime.split(' ')[1];
                vm.storeName=data.storeName;
                vm.storeAddress=data.storeAddress;
                vm.takeCode=data.takeCode;
                vm.logoPath=data.logoPath;
                vm.storeTel=data.storeTel;
                vm.remainingTime=data.remainingTime
                $('.storeLogo_img').css({
                    'background-image':'url('+data.logoPath+')',

                });

                var qrcode=new QRCode(document.getElementById("qrcode"),{
                    text:data.takeCode,
                    width:150,
                    height:150,
                    colorDark:"#000000",
                    colorLight:"#ffffff",
                    correctLevel:QRCode.CorrectLevel.H

                })

            }
        }

    })
}

//返回上一页
function returnBack() {
    window.history.back();  //返回上一页
}